---
apiVersion: v1
kind: ConfigMap
metadata:
  name: index-html
data:
  index.html: |
    <html>
    <head>
        <title>Тестовая страница</title>
        <meta charset="UTF-8">
    </head>
    <body>
    <h1>Тестовая страница</h1>
    <p>Простая тестовая страница, версия 2</a>.
    </p>
    </body>
    </html>
---
apiVersion: v1
kind: Service
metadata:
  name: openresty
spec:
  type: NodePort
  ports:
    - port: 80
      name: http
      targetPort: http
      nodePort: 31222
  selector:
    app: openresty
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: openresty
  labels:
    app: openresty
  annotations:
    reloader.stakater.com/auto: "true"
    configmap.reloader.stakater.com/reload: "index-html"
spec:
  replicas: 1
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app: openresty
  template:
    metadata:
      labels:
        app: openresty
    spec:
      containers:
        - name: openresty
          image: openresty/openresty:centos-rpm
          env:
            - name: NGINX_HOST
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
          resources:
            limits:
              cpu: "0.2"
              memory: "300Mi"
            requests:
              cpu: "0.1"
              memory: "100Mi"
          ports:
            - containerPort: 80
              name: http
              protocol: TCP
          volumeMounts:
            - name: index-html
              mountPath: /usr/local/openresty/nginx/html/
      volumes:
        - name: index-html
          configMap:
            name: index-html
